<?php
echo "<html><head><title>Unit Test</title></head>";

require_once 'TB_stockData.php';
require_once 'stock.php';
require_once 'utility.php';
require_once 'serviceprovider/netfonds.php';

////////////////////////////////////////////
$stockName = "AAPL.O";

$servProv1 = new NetFonds();
$tbl = new TBL_StockData($stockName, $servProv1->GetStockDataType(), $servProv1->HasTickData());

$fileLineCnt = $servProv1->BeginStockRead($stockName, time(), $tbl->LastData());

$recCnt = 0;
$remainingRecords = $servProv1->LocalFileRecordCount();
if($remainingRecords > 0){
	echo "<body onLoad=setTimeout(\"location.href='aistocklist.2fh.co/db/unittest.php'\", 60000);><br>TOT: $remainingRecords<br></body>";
	while(($stockData1 = $servProv1->GetNextData()) != FALSE){
		$tbl->SaveData($stockData1);
	
		//outputProgress($recCnt, $fileLineCnt);
		$recCnt++;
	}
}
else{
	echo "<body>FINITO TUTTO!!!!</body>";
}

?>